Skip to content

feat: uplift dependencies and update to support ink-v6.0.0-alpha #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 28, 2025

Conversation

chungquantin
Copy link
Contributor

@chungquantin chungquantin commented Apr 17, 2025

The PR uplift all dependencies to use latest version of ink! crate (v6.0.0) and migrate all code logic to support pallet-revive. Key critical changes made:

  • With the removal of type Debug in ChainExtension, the feature to mock contract calls fail completely and requires alternative approach using tracing API to support the feature.
  • Migrate examples/quick-start-with-drink to test with tracing API instead of decoding debug_message (which is removed in revive).
  • Disable test examples/chain-extension (chain extensions are deprecated in pallet-revive) and adds todo for a similar precompile replacement.

Examples Tracking

  • examples/contract-events
  • examples/dry-running
  • examples/flipper
  • examples/runtime-interaction
  • examples/multiple-contracts
  • examples/quick-start-with-drink

TO BE FIXED

Aside from all TODOs and deprecated calls of MockExtension, below issues need to be resolved:

  • examples/cross-contract-call-tracing: Consider implement the alternative tracing approach with the new Debugging Strategies
  • examples/mocking: Need to implement alternative approach without type Debug in ChainExtension
  • Issue: fix: Replace chain-extension test with similar precompile test #140 |examples/chain-extension: chain extensions are deprecated and replaced with precompiles in pallet-revive Current issue is the Memory trait in pallet-revive is required for the implementation of the chain extension but the Memory trait is in wasm module which is not exported as public. In the chain extension implementation of Pop Network, we forked the pallet-revive and modified it. Probably deprecated in the future with the introduction of precompiles.

* feat: migrate to revive (issue with revive_api)

* feat: migrate to revive for drink and cli

* fix: format

* chore: update Cargo.toml & lock file

* chore: update gitignore and remove .vscode

* fix: flipper example contract

* chore: update lockfile

* fix: example contracts

* fix: cli layout constraint params & example contracts

* chore: description for storage deposit limit

* chore: use ink main branch

* chore: resolve review comments

* chore: add dummy polkavm binary

* fix: call() string parameters

* chore: update multiple-contracts test

* chore: rename read contract code binary method

* chore: add comment

* chore: fix example contracts

* chore: update multiple_contract test

* fix: multiple contracts test

* chore: resolve review comments

* refactor: read_contract_binary
* chore: update dependencies to support ink v6 alpha

* chore: update Cargo.lock

* chore(mock): remove DrinkDebug and intercept calls

* chore(examples): bump lockfile and sync ink! v6
@chungquantin
Copy link
Contributor Author

chungquantin commented May 8, 2025

Note to the reviewers:

@davidsemakula davidsemakula self-requested a review May 20, 2025 08:22
@evilrobot-01 evilrobot-01 marked this pull request as draft May 20, 2025 13:48
@evilrobot-01 evilrobot-01 marked this pull request as ready for review May 20, 2025 13:48
@davidsemakula
Copy link
Contributor

fn find_wasm_blob(cwd: &Path) -> Option<(String, PathBuf)> {
let Ok(entries) = fs::read_dir(cwd.join("target/ink")) else {
return None;
};
let file = entries
.into_iter()
.filter_map(|e| e.ok())
.find(|e| e.path().extension().unwrap_or_default() == "wasm")?;
let raw_name = file
.file_name()
.into_string()
.expect("Invalid file name")
.strip_suffix(".wasm")
.expect("We have just checked file extension")
.to_string();
Some((raw_name, file.path()))
}

@chungquantin Looks like this (and may be its callers) need to be update to work with .polkavm binaries.

@chungquantin
Copy link
Contributor Author

fix(drink-cli): support polkavm and fix address

Fixed in 4b54e6f

@davidsemakula davidsemakula force-pushed the chungquantin/ink-6-alpha branch from 9046a40 to 57ddac2 Compare May 28, 2025 17:19
Copy link
Contributor

@davidsemakula davidsemakula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chungquantin !

@davidsemakula davidsemakula force-pushed the chungquantin/ink-6-alpha branch from 66119f0 to 36c91de Compare May 28, 2025 19:21
@davidsemakula davidsemakula force-pushed the chungquantin/ink-6-alpha branch from 36c91de to 58c778c Compare May 28, 2025 19:34
@davidsemakula davidsemakula merged commit 51beb81 into use-ink:main May 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants